home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1993…ch: Other People's Memory / ADC Developer CD (1993-03) (''Other People's Memory'')_iso / Dev.CD Mar 93.iso / Development Platforms / Apple II / Essentials / Technical.Notes / Misc / TN.MISC.014 < prev    next >
Encoding:
Text File  |  1992-07-15  |  10.4 KB  |  194 lines  |  [TEXT/GEOL]

  1. Apple II
  2. Technical Notes
  3. _____________________________________________________________________________
  4.                                                   Developer Technical Support
  5. Apple II Miscellaneous
  6. #14: Guidelines for Telecommunication Programs
  7.  
  8. Revised by: Matt Deatherage                                          May 1992
  9. Written by: Matt Deatherage                                         July 1989
  10.  
  11. This Technical Note discusses recommended guidelines to ensure future
  12. compatibility and maintain workable standards for telecommunication programs.
  13.  
  14. CHANGES SINCE JULY 1989:  Rewritten to be more explicit in passages.
  15. _____________________________________________________________________________
  16.  
  17.  
  18. Telecommunication programs have always been a particularly troublesome area on
  19. the Apple II as far as standards are concerned.  Exiting from terminal
  20. programs often leaves the system in an unbalanced state or leaves strange and
  21. unknown things upon the user's disks.  Yet complying with standards would not
  22. only make life easier for the users, it's not that hard for developers to do.
  23. This Note lists the primary guidelines Apple II telecommunication program
  24. developers should keep foremost in their minds.
  25.  
  26.  
  27. TALKING TO THE HARDWARE
  28.  
  29. Communicating with the modem through the interface provided by the user isn't
  30. always the easiest task in the world.  It often just can't be done at
  31. acceptable speeds when using high-level software routines, and sometimes it
  32. can't even be done at the firmware level.  It's widely known that the Super
  33. Serial Card can't keep up with 9600 bps communication unless a low-level
  34. driver uses the 6551 chip on the card directly--the firmware just can't do it.
  35. The Apple IIgs serial port firmware can easily keep up with 9600 bps, but the
  36. GS/OS generated character drivers for those ports can't do single character
  37. I/O at that speed.
  38.  
  39. In general, programs must use the highest level interface available to them
  40. that functions to specifications.  If dealing with speeds of less than 9600
  41. baud in 16-bit mode, on the Apple IIgs, use the GS/OS drivers.  That means if
  42. your terminal program uses both 4800 and 9600 baud, it should use the GS/OS
  43. drivers for 4800 baud and another method for 9600 baud--you cause more
  44. problems than you solve by using non-recommended methods for all speeds.
  45.  
  46. Remember that any GS/OS driver owns the slot or port it controls, and going
  47. around the drivers causes problems.  High-speed, highly-configurable loaded
  48. drivers for the serial ports may ship with the System Software in the future,
  49. and it would be unfortunate if your terminal program was the one that caused
  50. the driver to break.
  51.  
  52. For speeds of 9600 bps or higher with System Software 6.0, the driver can't
  53. help you.  It is necessary to go directly to the firmware or hardware and risk
  54. future incompatibility.  Remember that the firmware must be called from bank
  55. zero emulation mode.  If single character I/O isn't necessary, the driver can
  56. handle speeds of 9600 bps when used in multicharacter input or output.
  57.  
  58.  
  59.    NOTE : In the future, System Software may include loaded
  60.           drivers for the serial ports.  An application can tell
  61.           whether a driver is generated or loaded by examining bit
  62.           14 of the characteristics word returned by the GS/OS
  63.           DInfo call--a generated driver has this bit set.  A
  64.           loaded driver may be able to handle 9600 bps
  65.           single-character I/O, but a generated one may not.
  66.  
  67.  
  68. FILE TRANSFER CONSIDERATIONS
  69.  
  70. Transferring files is probably the most important function of a
  71. telecommunication program.  However, transferring the file's data itself is
  72. not always adequate.  Telecommunication programs must find a way to transfer a
  73. file's attributes as well as a file's contents to keep things running
  74. smoothly.
  75.  
  76. File attributes include the file's type and auxiliary type (necessary fields
  77. for most applications to identify their data files), the size of the file,
  78. creation and modification dates and times, as well as information about how
  79. many forks the file has, what file system it came from, and how the file is
  80. stored on disk.  In addition, when asked, GS/OS returns in its option_list
  81. information about the file that the native file system uses but GS/OS does not
  82. (information such as access privileges, native file types and creator types,
  83. parent directory IDs, extended attribute records and other information as
  84. important to the native file system as file type and auxiliary type are to
  85. GS/OS).
  86.  
  87. Any telecommunication program can devise a way to keep such attributes with a
  88. file when the file is transferred between two machines that are both running
  89. the program in question.  It is a much trickier task to address the issue of
  90. keeping all file attributes with files regardless of the programs involved in
  91. the transfer.  An industry-wide standard is necessary for such integration.
  92.  
  93. The Binary II standard, devised by Gary B. Little (and documented in the Apple
  94. II File Type Note for File Type $E0, Auxiliary Type $8000), has been accepted
  95. as a standard for maintaining these attributes for a number of years.  Many
  96. major telecommunication programs already incorporate support for this
  97. standard; Apple urges those that don't to do so at their earliest convenience.
  98.  
  99. Binary II is designed to keep attributes with files on the fly--it is not an
  100. archival standard and should not be used as such.  A standard like Binary II
  101. should always be used to keep attributes with a file; confusing it with an
  102. archival standard can result in files being transferred without their own
  103. attributes.  Even archival files must be transferred with their attributes.
  104. It is never acceptable to transfer a file without it's attributes.
  105.  
  106. Archival considerations are a completely separate issue.  An archival format
  107. and program must be carefully designed with archiving considerations in mind,
  108. such as manipulating files within the archive, preserving the attributes of
  109. the files archived, and allowing for a myriad of compression schemes.  The
  110. NuFX standard (documented in the Apple II File Type Note for File Type $E0,
  111. Auxiliary Type $8002) is such an archival format, which Apple recommends be
  112. used for those purposes.  The program ShrinkIt is an example of a NuFX
  113. archival utility.
  114.  
  115. In an ideal world, all files would be transferred with their attributes sent
  116. transparently by the telecommunication program.  The user would select the
  117. file to send, and the program would automatically send the attributes.  When
  118. the program receives a file, it would already have the attributes with the
  119. file, so no postprocessing by the user would be necessary to use the file.
  120. Even archival files such as NuFX should be transferred with all attributes
  121. intact.  Although the archival utility may allow the user to select any file
  122. for processing (in case the file's attributes were lost), assuming that this
  123. will happen implies that it's acceptable.  It is not.  No file should ever be
  124. transferred without all its attributes, down to, and including the  GS/OS
  125. option_list, if present.
  126.  
  127.  
  128. APPLE IIGS CONSIDERATIONS
  129.  
  130. A few more guidelines for Apple IIgs-specific telecommunication applications
  131. follow:
  132.  
  133.    o   Don't ignore slot configurations.  Attempting to use a serial port
  134.        through hardware while an interface card for that slot is switched in
  135.        will break dynamic slot arbitration if, and when, it becomes
  136.        available, unless the application does not use the firmware.
  137.  
  138.    o   Be a good neighbor to interrupt handlers.  Interrupts will be coming
  139.        through that you did not enable.  (This is true for Apple IIe
  140.        computers with Workstation Cards, and is also true for IIgs computers
  141.        even when AppleTalk is not involved.)  Programs not prepared for this
  142.        could bring the system down.
  143.  
  144.  
  145.        Stealing main interrupt vectors is not a good idea.  The main
  146.        interrupt handler is already very tight code, and it runs in ROM 10%
  147.        faster than any code you can replace it with in RAM.  If you patch out
  148.        the main interrupt vector and add more than about two instructions to
  149.        the code path before returning to the ROM, AppleTalk will lose data.
  150.        If you patch out the main interrupt vector, you make it impossible for
  151.        Apple to add additional functionality by patching the same vector
  152.        without breaking AppleTalk--and the vector is there for system
  153.        software's convenience, not yours.
  154.  
  155.        I can't make it any plainer than this--do not patch out the main
  156.        interrupt vector unless it absolutely, positively cannot be avoided.
  157.        The only cases we know about where it absolutely can't be avoided are
  158.        very high-speed communications from slot-based cards; high-speed
  159.        serial communications from the serial ports can be handled by patching
  160.        the serial interrupt vector (see Apple IIgs Technical Note #18,
  161.        Do-It-Yourself SCC Interrupts).  If you have to patch the main
  162.        interrupt vector to run at 38400 bps, unpatch it when you switch to
  163.        2400 baud.  Only patch the vector while it's absolutely necessary, and
  164.        don't leave it continually patched just because it's easier.  You're
  165.        breaking things when you do that, whether your testing reveals it to
  166.        you or not.
  167.  
  168.        If you must patch out the main interrupt vector, make it very clear to
  169.        your users, both in the documentation and on-screen, that other system
  170.        services like AppleTalk will not function and may not return until the
  171.        computer is restarted.  Give them a chance to back out.
  172.  
  173.    o   Don't go stepping on things you don't own.  It is better to alert the
  174.        user that a certain resource (like a slot or a port) is not available
  175.        than to blindly switch it in and crash the system.  Never switch slots
  176.        without using the Slot Arbiter.
  177.  
  178.    o   Behave yourself.  Don't make wild assumptions or do things differently
  179.        just because you're a terminal program and you think you have to do it
  180.        for speed.  Most users won't be impressed by a terminal program that's
  181.        fast and robust if it breaks every time they activate a desk accessory
  182.        or if they have to reboot the system when they're done with it.  Don't
  183.        compromise system integrity for superficial functionality.
  184.  
  185.  
  186. Further Reference
  187. _____________________________________________________________________________
  188.  
  189.    o   Apple IIgs Firmware Reference
  190.    o   Apple IIgs Hardware Reference
  191.    o   Apple IIgs Technical Note #18, Do-It-Yourself SCC Interrupts
  192.    o   Apple II File Type Notes, File Type $E0, Auxiliary Type $8000
  193.    o   Apple II File Type Notes, File Type $E0, Auxiliary Type $8002
  194.